//
//  TUIMessageCellData.h
//  PeachDoctor
//
//  Created by ui on 2019/9/27.
//  Copyright © 2019 四川睡呗科技有限公司. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "THelper.h"
#import <ImSDK/ImSDK.h>

@class PeachMsgCustomData;

NS_ASSUME_NONNULL_BEGIN


@interface PeachMessageModel : NSObject

/// 1.1 内层消息
/// IM SDK 提供的消息对象。内含各种获取消息信息的成员函数，包括获取优先级、获取元素索引、获取离线消息配置信息等。 详细信息请参考 TXIMSDK_iOS\Frameworks\ImSDK.framework\Headers\TIMMessage.h
@property (nonatomic, strong) TIMMessage *TIMMessage;

/// 1.2 获取消息的发送方 发送方 identifier
@property (nonatomic, copy) NSString *fromUser;

/// 1.3 消息 ID
/// 1. 当消息生成时，就已经固定，这种方式可能跟其他用户产生的消息冲突，需要再加一个时间约束，可以认为 10 分钟以内的消息可以使用 msgId 区分，需要在同一个会话内判断。
/// 2. 对于发送成功的消息或则从服务器接收到的消息，请使用 uniqueId 判断消息的全局唯一。
@property (nonatomic, copy) NSString *msgId;

/// 1.4 自己是否已读 TRUE：已读；FALSE：未读
@property (nonatomic, assign) BOOL isRead;

/// 1.5 当前消息的时间戳 当消息还没发送成功，此时间为根据 Server 时间校准过的本地时间，发送成功后会改为准确的 Server 时间
@property (nonatomic, assign) long timestamp;

/// 1.6 消息状态 TIMMessageStatus 消息状态
@property (nonatomic, assign) TIMMessageStatus status;

/// 1.7 是否发送方 TRUE：表示是发送消息；FALSE：表示是接收消息
@property (nonatomic, assign) BOOL isSelf;

/// 1.8 对方是否已读（仅 C2C 消息有效） TRUE：已读；FALSE：未读
@property (nonatomic, assign) BOOL isPeerReaded;

/// 附件
@property (nonatomic, strong)   id extra;

/// 消息类型
@property (nonatomic, assign)   TIMMessageType msgCode;
/// 消息体
@property (nonatomic, strong)   id msgContent;

/// 是否展示消息
@property (nonatomic, assign)   BOOL isHidden;

/// 消息类型
@property (nonatomic, copy)     NSString *msgType;

/// 接收方id
@property (nonatomic, copy)     NSString *peer;

/// 描述文字
@property (nonatomic, copy)     NSString *desc;

/// 扩展字段
@property (nonatomic, copy)     NSString *ext;

/// 消息已读回执
/// @param message <#message description#>
- (void)setReadMessage:(TIMMessage *)message;

@end

@interface PeachMsgTextModel : NSObject

/// 文本
@property (nonatomic, strong) NSString *text;

@end

@interface PeachMsgVoiceModel : NSObject

/// 语音地址
@property (nonatomic, strong) NSString *url;

/// 语音时长
@property (nonatomic, assign) int duration;

@end

@interface PeachMsgImageModel : NSObject

/// 图片地址
@property (nonatomic, strong) NSString *url;

/// 存储uuid
@property (nonatomic, strong) NSString *uuid;

@end

@interface PeachMsgCustomModel : NSObject

@property (nonatomic, copy) NSString *customType;
@property (nonatomic, copy) NSString *childType;
@property (nonatomic, strong) PeachMsgCustomData *data;

@end

@interface PeachMsgCustomData : NSObject

@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *roomId;
@property (nonatomic, copy) NSString *time;
@property (nonatomic, copy) NSString *type;

@end

@interface PeachMsgContentText : NSObject

/// 消息文本
@property (nonatomic, strong) NSString *text;

@end


@interface PeachMsgContentVoice : NSObject

/// 语音地址
@property (nonatomic, strong) NSString *dataPath;

/// 语音时长
@property (nonatomic, assign) int duration;

/// 语音体
@property (nonatomic, strong) TIMSoundElem *imSound;

@end

@interface PeachMsgContentImage : NSObject

/// 本地图片
@property (nonatomic, strong) TIMImage *localImage;

/// 大图
@property (nonatomic, assign) TIMImage *largeImage;

/// 缩略图
@property (nonatomic, strong) TIMImage *thumbImage;

@end

NS_ASSUME_NONNULL_END
